跳到主要内容

1 商品详情

1.1 需求分析

需求说明:当点击某一个商品的时候,此时就需要在商品详情页面展示出商品的详情数据,商品详情页所需数据:

1、商品的基本信息

2、当前商品sku的基本信息

3、商品轮播图信息

4、商品详情(详细为图片列表)

5、商品规格信息

6、当前商品sku的规格属性

如下所示:

item

整体的访问流程如下所示:

image-20230707182222463

查看接口文档:

商品详情接口地址及示例数据

get /api/product/item/{skuId}
返回结果:
{
"code": 200,
"message": "成功",
"data": {
"productSku": {
"id": 1,
"createTime": "2023-05-25 22:21:07",
"skuCode": "1_0",
"skuName": "小米 红米Note10 5G手机 颜色:白色 内存:8G",
"productId": 1,
"thumbImg": "http://139.198.127.41:9000/spzx/20230525/665832167-5_u_1 (1).jpg",
"salePrice": 1999.00,
"marketPrice": 2019.00,
"costPrice": 1599.00,
"stockNum": 99,
"saleNum": 1,
"skuSpec": "颜色:白色,内存:8G",
"weight": "1.00",
"volume": "1.00",
"status": null,
"skuSpecList": null
},
"product": {
"id": 1,
"createTime": "2023-05-25 22:21:07",
"name": "小米 红米Note10 5G手机",
"brandId": 1,
"category1Id": 1,
"category2Id": 2,
"category3Id": 3,
"unitName": "个",
"sliderUrls": "",
"specValue": "[{\"key\":\"颜色\",\"valueList\":[\"白色\",\"红色\",\"黑色\"]},{\"key\":\"内存\",\"valueList\":[\"8G\",\"18G\"]}]",
"status": 1,
"auditStatus": 1,
"auditMessage": "审批通过",
"brandName": null,
"category1Name": null,
"category2Name": null,
"category3Name": null,
"productSkuList": null,
"detailsImageUrls": null
},
"specValueList": [
{
"valueList": [
"白色",
"红色",
"黑色"
],
"key": "颜色"
},
{
"valueList": [
"8G",
"18G"
],
"key": "内存"
}
],
"detailsImageUrlList": [
"http://139.198.127.41:9000/spzx/20230525/665832167-5_u_1.jpg",
"http://139.198.127.41:9000/spzx/20230525/665832167-6_u_1.jpg",
"http://139.198.127.41:9000/spzx/20230525/665832167-4_u_1.jpg",
"http://139.198.127.41:9000/spzx/20230525/665832167-1_u_1.jpg",
"http://139.198.127.41:9000/spzx/20230525/665832167-5_u_1 (1).jpg",
"http://139.198.127.41:9000/spzx/20230525/665832167-3_u_1.jpg"
],
"skuSpecValueMap": {
"白色 + 12G": 13,
"白色 + 8G": 12
},
"sliderUrlList": [
"http://139.198.127.41:9000/spzx/20230525/665832167-5_u_1.jpg",
"http://139.198.127.41:9000/spzx/20230525/665832167-6_u_1.jpg",
"http://139.198.127.41:9000/spzx/20230525/665832167-4_u_1.jpg",
"http://139.198.127.41:9000/spzx/20230525/665832167-1_u_1.jpg",
"http://139.198.127.41:9000/spzx/20230525/665832167-5_u_1 (1).jpg",
"http://139.198.127.41:9000/spzx/20230525/665832167-3_u_1.jpg"
]
}
}